package com.xl.thisword;

/**
 * @ClassDescription:
 * @JdkVersion: 1.8
 * @Author: lei·xie
 * @Created: 2024/3/14 0014 10:11
 */
public class Test {
    public static void main(String[] args) {
        Student s1 = new Student();
        System.out.println(s1);
        s1.printThis();

        System.out.println("------------------------");
        Student s2 = new Student();
        System.out.println(s2);
        s2.printThis();

        System.out.println("------------------------");

        Student s3 = new Student();
        s3.score = 100;
        s3.printPass(200);

        String inputString = "这是一个测试字符串，包含一些中文字符。";
        String outputString = replaceChineseWithSpace(inputString);
        System.out.println("原始字符串：" + inputString);
        System.out.println("修改后的字符串：" + outputString);
    }

    public static String replaceChineseWithSpace(String input) {
        // 使用正则表达式查找中文字符
        String chinesePattern = "[\\u4e00-\\u9fff]+";
        // 将中文字符替换为空格
        return input.replaceAll(chinesePattern, " ");
    }

}
